﻿using FluentNHibernate.Mapping;
using SimpleScrum.Core.Entities;

namespace SimpleScrum.Core.Mappings
{
    public class SprintMap : ClassMap<Sprint>
    {
        public SprintMap()
        {
            Table("Sprint");
            LazyLoad();
            Id(x => x.Id).Column("ID").GeneratedBy.GuidComb();
            Map(x => x.Name).Column("Name");
            Map(x => x.Description).Column("Description");
            Map(x => x.VersionNo).Column("VersionNo");
            Map(x => x.StartDate).Column("StartDate");
            Map(x => x.EndDate).Column("EndDate");
            References(x=>x.Project).Column("ProjectId").Cascade.All();
        }
    }
}